package com.zz.parkingsystem.service.impl;

import com.zz.parkingsystem.dto.GeoDTO;
import com.zz.parkingsystem.entity.Geomagnetism;
import com.zz.parkingsystem.mapper.GeomagnetismMapper;
import com.zz.parkingsystem.service.PCGeoService;
import com.zz.parkingsystem.vo.AllGeoVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PCGeoServiceImpl implements PCGeoService {
    @Resource
    private GeomagnetismMapper geomagnetismMapper;


    @Override
    public List<Geomagnetism> selAllGeo() {
        return geomagnetismMapper.selAllGeo();
    }

    @Override
    public Long getCount(GeoDTO geoDto) {
        return geomagnetismMapper.getCount(geoDto);
    }

    @Override
    public List<AllGeoVO> getAllGeo(GeoDTO geoDto) {
        return geomagnetismMapper.getAllGeo(geoDto);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        Geomagnetism geomagnetism = geomagnetismMapper.selectByPrimaryKey(id);
        if(geomagnetism!=null){
            int i = geomagnetismMapper.deleteByPrimaryKey(id);
            return i;
        }else{
            return 0;
        }
    }

    @Override
    public int insertSelective(Geomagnetism record) {
       return geomagnetismMapper.insertSelective(record);
    }

    @Override
    public Geomagnetism selectByPrimaryKey(Long id) {
        return geomagnetismMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Geomagnetism record) {
        return geomagnetismMapper.updateByPrimaryKeySelective(record);
    }
}
